package 面试.新国都;

import java.util.Scanner;

/**
 * @author : K k
 * @date : 19:40 2020/10/14
 */
public class 括号配对 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String s = in.nextLine();
        int count=0;//括号
        for (int i=0;i<s.length();i++){
            if (s.charAt(i)=='('){
                count++;
            }else if(count>0){
                count--;
            }else {
                System.out.println("NO");
            }
        }
        if (count==0) {
            System.out.println("Yes");
        }else {
            System.out.println("NO");
        }
    }

}
